#!/usr/bin/env bash
########################
tmoe_terminal_main_menu() {
    RETURN_TO_WHERE='tmoe_terminal_main_menu'
    DEPENDENCY_01=""
    TMOE_APP=$(whiptail --title "TERMINAL APP" --menu \
        "Which software do you want to install？" 0 50 0 \
        "0" "🌚 Return to previous menu 返回上级菜单" \
        "1" "cool-retro-term(穿梭时光,感受复古风,领略CRT的魅力)" \
        "2" "Terminology(酷炫终端,支持预览图片和视频)" \
        "3" "Terminator(支持分屏的终端)" \
        "4" "Yakuake(基于KDE Konsole技术的下拉式终端)" \
        "5" "Guake(GNOME下拉式终端)" \
        "6" "Tilda(雷神之锤风格的下拉式终端)" \
        "7" "Konsole(KDE默认终端)" \
        "8" "Xfce4-Terminal(xfce默认终端)" \
        "9" "Gnome-Terminal(gnome默认终端)" \
        "10" "LXTerminal(lxde默认终端)" \
        "11" "Mate-Terminal(mate默认终端)" \
        "12" "LilyTerm(基于libvte,追求轻量和快速)" \
        "13" "Sakura(如櫻花般優雅)" \
        "14" "Rxvt(资源占用低,启动速度快)" \
        "15" "st(简单,清晰,且节约资源)" \
        "16" "Aterm(基于rxvt,高度可定制)" \
        "17" "xterm/Uxterm(X11标准指定的虚拟终端)" \
        3>&1 1>&2 2>&3)
    ##########################
    #Terminus (x64,超唯美现代化终端)
    case "${TMOE_APP}" in
    0 | "") beta_features ;;
    1)
        DEPENDENCY_02="cool-retro-term"
        printf "%s\n" "${YELLOW}https://github.com/Swordfish90/cool-retro-term${RESET}"
        ;;
    2)
        DEPENDENCY_02="terminology"
        printf "%s\n" "tycat命令预览图片和视频,tysend复制文件,tyls显示文件列表"
        ;;
    3)
        DEPENDENCY_02="terminator"
        printf "%s\n" "按Ctrl+Shift+O或E进行切割"
        ;;
    4) DEPENDENCY_02="yakuake" ;;
    5) DEPENDENCY_02="guake" ;;
    6) DEPENDENCY_02="tilda" ;;
    7) DEPENDENCY_02="konsole" ;;
    8) DEPENDENCY_02="xfce4-terminal" ;;
    9) DEPENDENCY_02="gnome-terminal" ;;
    10) DEPENDENCY_02="lxterminal" ;;
    11) DEPENDENCY_02="mate-terminal" ;;
    12) DEPENDENCY_02="lilyterm" ;;
    13) DEPENDENCY_02="sakura" ;;
    14) DEPENDENCY_02="rxvt" ;;
    15)
        DEPENDENCY_02="stterm"
        printf "%s\n" "You can type st to start it.输st或stterm启动"
        ;;
    16)
        DEPENDENCY_02="atem"
        printf "%s\n" "You can type aterm to start it.输aterm启动"
        ;;
    17) DEPENDENCY_02="xterm" ;;
    esac
    ##########################
    beta_features_quick_install
    case ${DEPENDENCY_02} in
    cool-retro-term)
        case ${LINUX_DISTRO} in
        debian)
            printf "%s\n" "若安装失败，则请手动添加ppa源，${GREEN}sudo add-apt-repository${RESET} ${BLUE}ppa:noobslab/apps${RESET}"
            ;;
        esac
        ;;
    terminology)
        printf "%s\n" "tycat命令预览图片和视频,tysend复制文件,tyls显示文件列表"
        ;;
    stterm)
        printf "%s\n" "You can type st to start it.输st或stterm启动"
        ;;
    aterm)
        printf "%s\n" "You can type aterm to start it.输aterm启动"
        ;;
    esac
    press_enter_to_return
    tmoe_terminal_main_menu
}
#######################
tmoe_terminal_main_menu
